<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button class="btn">点我获取</button>
    <script src="./axios/axios.min.js"></script>
    <script>
        document.querySelector('.btn').addEventListener('click',function(){
            axios({
                url:'http://hmajax.itheima.net/api/register',
                method:'post',
                data:{
                    username:'3122798886',
                    password:'123456'
                }
            }).then(item=>{
                console.log(item.data);
            })
        })
    </script>
</body>
</html>